<?php

//ctype_cntrl(mixed $text): bool
//ctype_cntrl — 检测控制字符

$strings = array('string1' => "\n\r\t", 'string2' => "arf12");
foreach ($strings as $name => $testcase) {
    if (ctype_cntrl($testcase)) {
        echo "all ok\n";
    } else {
        echo "no all \n";
    }
}
